package com.idlefish.flutterboost;

import androidx.annotation.NonNull;

import java.util.Map;

public class FlutterBoostRouteOptions {
    private final String pageName;
    private final Map<String, Object> arguments;
    private final int requestCode;
    private final String uniqueId;
    private final boolean opaque;
    private final String payType;
    private final int payId;

    private FlutterBoostRouteOptions(Builder builder) {
        this.pageName = builder.pageName;
        this.arguments = builder.arguments;
        this.requestCode = builder.requestCode;
        this.uniqueId = builder.uniqueId;
        this.opaque = builder.opaque;
        this.payType = builder.payType;
        this.payId = builder.payId;
    }

    public int getPayId() {
        return payId;
    }

    public String payType() {
        return payType;
    }

    public String pageName() {
        return pageName;
    }

    public Map<String, Object> arguments() {
        return arguments;
    }

    public int requestCode() {
        return requestCode;
    }

    public String uniqueId() {
        return uniqueId;
    }

    public boolean opaque() {
        return opaque;
    }

    @Override
    public String toString() {
        return "FlutterBoostRouteOptions{" +
                "pageName='" + pageName + '\'' +
                ", arguments=" + arguments +
                ", requestCode=" + requestCode +
                ", uniqueId='" + uniqueId + '\'' +
                ", opaque=" + opaque +
                ", payType='" + payType + '\'' +
                '}';
    }

    public static class Builder {
        private String pageName;
        private Map<String, Object> arguments;
        private int requestCode;
        private String uniqueId;
        private boolean opaque = true;
        private String params;
        private String payType;
        private int payId;

        public Builder payId(int payId) {
            this.payId = payId;
            return this;
        }


        public String getParams() {
            return params;
        }

        public Builder() {
        }

        public Builder pageName(String pageName) {
            this.pageName = pageName;
            return this;
        }
        public Builder payType(String payType) {
            this.payType = payType;
            return this;
        }

        public Builder params(String params) {
            this.params = params;
            return this;
        }

        public Builder arguments(Map<String, Object> arguments) {
            this.arguments = arguments;
            return this;
        }

        public Builder requestCode(int requestCode) {
            this.requestCode = requestCode;
            return this;
        }

        public Builder uniqueId(String uniqueId) {
            this.uniqueId = uniqueId;
            return this;
        }

        public Builder opaque(boolean opaque) {
            this.opaque = opaque;
            return this;
        }

        public FlutterBoostRouteOptions build() {
            return new FlutterBoostRouteOptions(this);
        }
    }

}